package utils;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;



/**
 * 解析json文件
 * 
 */
public class AnalysisJson {
	public String ReadFile(String Path){
		BufferedReader reader = null;
		String laststr = "";
		FileInputStream  fileInputStream =null;
		InputStreamReader inputStreamReader = null;
		try{
			fileInputStream = new FileInputStream(Path);
			inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
			reader = new BufferedReader(inputStreamReader);
			String tempString = null;
			while((tempString = reader.readLine()) != null){
				laststr += tempString;
			}
				reader.close();
		}catch(IOException e){
			e.printStackTrace();
		}finally{
			
			if(null != reader){
				try {
					reader.close();
					reader=null;
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			if(null != inputStreamReader){
				try {
					inputStreamReader.close();
					inputStreamReader=null;
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			if(null != fileInputStream){
				try {
					fileInputStream.close();
					fileInputStream=null;
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
			return laststr;
	}
}
